using Microsoft.SqlServer.Management.Sdk.Sfc;
using System;
using System.ComponentModel;

namespace Microsoft.SqlServer.Management.SqlManagerUI
{
	[LocalizedPropertyResources("Microsoft.SqlServer.Management.SqlManagerUI.GenScriptWizSR"), TypeConverter(typeof(LocalizableTypeConverter))]
	internal sealed class GenWizPublishOptions : GenWizOptionsBase
	{
		private GenWizOptionsBase.BooleanTypeOptions _useTransactionForPublish;

		[DisplayCategoryKey("General"), DisplayDescriptionKey("UseTransactionForPublishDesc"), DisplayNameKey("UseTransactionForPublish")]
		public GenWizOptionsBase.BooleanTypeOptions UseTransactionForPublish
		{
			get
			{
				return this._useTransactionForPublish;
			}
			set
			{
				this._useTransactionForPublish = value;
			}
		}

		public GenWizPublishOptions(int version) : base(version)
		{
			base.GenerateScriptForDependentObjects = true;
			base.ScriptIndexes = true;
		}

		public GenWizPublishOptions(int version, GenWizOptionsBase options) : this(version)
		{
			if (options != null)
			{
				base.LoadOptionBase(options);
				if (options is GenWizPublishOptions)
				{
					this.UseTransactionForPublish = ((GenWizPublishOptions)options).UseTransactionForPublish;
				}
			}
		}
	}
}
